#ifndef	RF_SPI_H
#define	RF_SPI_H

#include "sys.h"

#define SPI_CS_GPIO_PIN           LL_GPIO_PIN_0
#define SPI_SCK_GPIO_PIN          LL_GPIO_PIN_1
#define SPI_MOSI_GPIO_PIN         LL_GPIO_PIN_2
#define SPI_MISO_GPIO_PIN         LL_GPIO_PIN_3



#define CS_Low		                LL_GPIO_ResetOutputPin(GPIOB, SPI_CS_GPIO_PIN);
#define CS_High		                LL_GPIO_SetOutputPin(GPIOB, SPI_CS_GPIO_PIN);

#define SCK_High                  LL_GPIO_SetOutputPin(GPIOB, SPI_SCK_GPIO_PIN);
#define SCK_Low                   LL_GPIO_ResetOutputPin(GPIOB, SPI_SCK_GPIO_PIN);

#define SPI_MOSI_High             LL_GPIO_SetOutputPin(GPIOB, SPI_MOSI_GPIO_PIN);
#define SPI_MOSI_Low              LL_GPIO_ResetOutputPin(GPIOB, SPI_MOSI_GPIO_PIN);

#define Read_MISO                   LL_GPIO_IsInputPinSet(GPIOB,SPI_MISO_GPIO_PIN)

void RF_GPIO_Init(void);
void RF_SPI_Init(void);
void SPI_Write_Byte(unsigned char buff);
unsigned char SPI_Read_Byte(void);
void SPI_Write_Reg(unsigned char RfAdress,unsigned char RfData);
unsigned char SPI_Read_Reg(unsigned char RfAdress);
void Write_RF_Buff(unsigned char RFAdress , unsigned char *pBuff , unsigned char Len);
void Read_RF_Buff(unsigned char RFAdress , unsigned char *pBuff , unsigned char Len);




#endif

